import { lazy } from 'react'
import Home from '../view/Home.jsx'
import { HomeO, AppsO, GiftO, CartO,UserO } from '@react-vant/icons'
const routers = [
    {
        path:'/home',
        component:Home,
        children:[
            {
                path:'/home/index',
                theme:"首页",
                component:lazy(()=>import('../view/home/Index.jsx')),
                icon:<HomeO  />
            },
            {
                path:'/home/classify',
                theme:"分类",
                component:lazy(()=>import('../view/home/Classify.jsx')),
                icon:<AppsO  />
            },
            {
                path:'/home/amaze',
                theme:"惊喜",
                component:lazy(()=>import('../view/home/Amaze.jsx')),
                icon:<GiftO  />
            },
            {
                path:'/home/cart',
                theme:"购物车",
                component:lazy(()=>import('../view/home/Cart.jsx')),
                icon:<CartO  />
            },
            {
                path:'/home/my',
                theme:"我的",
                component:lazy(()=>import('../view/home/My.jsx')),
                icon:<UserO  />
            }
        ]
    },
    {
        path:'/detail/:id',
        component:lazy(()=>import('../view/Detail.jsx'))
    },
    {
        path:'/',
        redirect: '/home/index',  // 重定向:重新指向其它path,会改变网址
    }

]
export default routers